<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-wrap align-center justify-between benben-position-layout flex informationShops_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center informationShops_fd0_0' @tap.stop="handleJumpDiy"
					data-type="back" data-url="1">
					<image class='informationShops_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"296.png"'></image>
				</view>
				<text class='informationShops_fd0_1'>店铺信息</text>
				<view class='flex flex-wrap align-center informationShops_fd0_0'>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---店铺信息flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout informationShops_flex_1">
				<view class='flex align-center justify-between informationShops_fd1_0'>
					<text class='informationShops_fd1_0_c0'>*</text>
					<text class='informationShops_fd1_0_c1'>店铺名称</text>
					<benben-input class='flex-sub informationShops_fd1_0_c2' type="text" :placeholder="`请输入店铺名称`"
						confirm-type="done" :maxlength="50"
						placeholder-style="color:rgba(187, 187, 187, 1);font-size:32rpx"
						v-model="dataMessage.store_name" />
				</view>
				<view class='flex align-center informationShops_fd1_0'>
					<text class='informationShops_fd1_0_c0'>*</text>
					<text class='informationShops_fd1_1_c1'>店铺logo</text>
					<text class='informationShops_fd1_1_c2'>(72*72)</text>
					<view class="upload position-relative">
						<image class=" informationShops_fd1_1_c3_image" mode="aspectFit"
							@tap="soloChooseImage('store_logo','store_logo',dataMessage,dataMessage)"
							:src="dataMessage.store_logo ? dataMessage.store_logo : STATIC_URL+'300.png'">
						</image>
					</view>
				</view>
				<view class='flex align-center informationShops_fd1_0'>
					<text class='informationShops_fd1_0_c0'>*</text>
					<text class='informationShops_fd1_1_c1'>店铺背景</text>
					<text class='informationShops_fd1_1_c2'>(375*135)</text>
					<view class="upload position-relative">


						<image class=" informationShops_fd1_2_c3_image" mode="aspectFit"
							@tap="soloChooseImage('store_backdrop','store_backdrop',dataMessage,dataMessage)"
							:src="dataMessage.store_backdrop ? dataMessage.store_backdrop : STATIC_URL+'299.png'">
						</image>
					</view>
				</view>
				<view class='flex align-center justify-between informationShops_fd1_0'
					@tap.stop="pickerDiy1680491677140=true">
					<text class='informationShops_fd1_0_c0'>*</text>
					<text class='informationShops_fd1_1_c1'>店铺所在地</text>
					<text class='flex-sub informationShops_fd1_3_c2' v-if=" dataMessage.location==''">请选择</text><text
						class='flex-sub informationShops_fd1_3_c2_1'
						v-if=" dataMessage.location!=''">{{dataMessage.location}}</text>
					<image class='informationShops_fd1_3_c3' mode="aspectFit" :src='STATIC_URL+"301.png"'></image>
				</view>
				<view class='flex flex-direction align-stretch justify-between informationShops_fd1_0'>
					<view class='flex flex-wrap align-center informationShops_fd1_4_c0'>
						<text class='informationShops_fd1_0_c0'>*</text>
						<text class='informationShops_fd1_1_c1'>店铺详细地址</text>
					</view>
					<view class='flex flex-wrap informationShops_fd1_4_c1'>
						<textarea class='flex informationShops_input_fd1_4_c1' confirm-type="done"
							:placeholder="'请输入详细地址'" :maxlength="240"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
							v-model="dataMessage.store_address" />

					</view>
				</view>
				<view class='flex flex-direction align-stretch justify-between informationShops_fd1_0'>
					<view class='flex flex-wrap align-center informationShops_fd1_4_c0'>
						<text class='informationShops_fd1_0_c0'>*</text>
						<text class='informationShops_fd1_1_c1'>店铺详细简介</text>
					</view>
					<view class='flex flex-wrap informationShops_fd1_4_c1'>
						<textarea class='flex informationShops_input_fd1_4_c1' confirm-type="done"
							:placeholder="'请输入店铺简介'" :maxlength="240"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
							v-model="dataMessage.store_introduce" />

					</view>
				</view>
				<view class='flex align-center justify-between informationShops_fd1_0'>
					<text class='informationShops_fd1_0_c0'>*</text>
					<text class='informationShops_fd1_1_c1'>客服电话</text>
					<benben-input class='flex-sub informationShops_fd1_0_c2' type="number" :placeholder="`请输入客服电话`"
						confirm-type="done" :maxlength="11"
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="dataMessage.service_phone" />
				</view>
			</view>

			<!---店铺信息flex布局结束-->
			<!--店铺所在地选择器开始 -->
			<benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1680491677140"
				:label.sync='dataMessage.location' mode='region' :mask-show='true' :picker-height='88'
				:hide-area='false'>
				<template #picker-header>
					<view class='flex flex-wrap align-center justify-between informationShops_picker2_0'>
						<text class='informationShops_picker2_0_c0'
							@tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
						<text class='informationShops_picker2_0_c1'>选择地址</text>
						<text class='informationShops_picker2_0_c2'
							@tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确定</text>
					</view>
				</template>
			</benben-picker>
			<!--店铺所在地选择器结束 -->
			<view class="flex align-center justify-center benben-position-layout flex informationShops_flex_3">
				<button class='informationShops_fd3_0' @tap.stop="handleJumpDiy" data-type="back"
					data-url="1">上一步</button>
				<button class='informationShops_fd3_1' @tap.stop="submitMessageFunc()">提交</button>

			</view>
			<view :style="{height: '180rpx'}"></view>


		</view>
	</view>
</template>
<script>
	import UploadImage from '@/common/utils/upload-image.js'
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"pickerDiy1680491677140": false,
				"dataMessage": {
					"aid": "",
					"member_id": "",
					"member_account": "",
					"member_name": "",
					"person": "",
					"idcard_no": "",
					"province_idc": "",
					"province_name": "",
					"city_id": "",
					"city_name": "",
					"district_id": "",
					"district_name": "",
					"address": "",
					"store_province_id": "",
					"store_province_name": "",
					"store_city_id": "",
					"store_city_name": "",
					"store_district_id": "",
					"store_district_name": "",
					"store_address": "",
					"contacts_name": "",
					"contacts_phone": "",
					"idcard_front": "",
					"idcard_reverse": "",
					"store_name": "",
					"store_logo": "",
					"business_licence": "",
					"joinin_state": "",
					"joinin_message": "",
					"range": "",
					"reason": "",
					"merchant_ratio": "",
					"apply_type": "",
					"company_name": "",
					"company_province_id": "",
					"company_city_id": "",
					"company_district_id": "",
					"company_address": "",
					"credit_code": "",
					"store_level": "",
					"main_industry": "",
					"stay_time": "",
					"pay_img": "",
					"pay_remarks": "",
					"pay_money": "",
					"pay_time": "",
					"run_type": "",
					"expiration_time": "",
					"store_backdrop": "",
					"service_phone": "",
					"store_introduce": "",
					"workday": "",
					"business_hours": "",
					"enter_money": "",
					"qualification_certificate": "",
					"create_time": "",
					"true_name": "",
					"account_id": "",
					"qrcode": "",
					"bank_branch": "",
					"bank_address": "",
					"run_type_id": "",
					"main_industry_id": "",
					"stay_time_id": "",
					"company_province_name": "",
					"company_city_name": "",
					"company_district_name": "",
					"company_address_id": "",
					"legal_name": "",
					"legal_tel": "",
					"legal_idcard": "",
					"legal_front": "",
					"legal_opposite": "",
					"store_location": "",
					"account_type": "",
					"service_fee": "",
					"location": ""
				}
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			}
		},
		watch: {},
		onLoad(options) {
			this.getShopFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//上传单图、多图方法
			soloChooseImage(id, path, obj, obj1, fnName = false) {
				if (!this.setCheckPermission(2)) {
					return
				}
				let self = this
				if (!obj) obj = this
				if (!obj1) obj1 = this
				if (self.uploading) {
					return
				}
				// 从相册中选择图片
				uni.chooseImage({
					count: 1, // 默认3
					sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
					success: function(res) {
						self.uploading = true
						// 开始上传
						new UploadImage(res.tempFiles, {
							complete: function(res) {
								self.uploading = false
								if (id) self.$set(obj, id, res[0].id)
								if (path) self.$set(obj1, path, res[0].path)
								if (fnName) self[fnName]()
							},
						})
					},
				})
			},
			//提交店铺信息
			async submitMessageFunc() {
				if (!validate(this.dataMessage.store_name, 'require')) {
					this.$message.info('店铺名称不能为空');
					return false;
				}
				if (!validate(this.dataMessage.store_logo, 'require')) {
					this.$message.info('店铺logo不能为空');
					return false;
				}
				if (!validate(this.dataMessage.store_backdrop, 'require')) {
					this.$message.info('店铺背景不能为空');
					return false;
				}
				if (!validate(this.dataMessage.location, 'require')) {
					this.$message.info('店铺所在地不能为空');
					return false;
				}
				if (!validate(this.dataMessage.store_address, 'require')) {
					this.$message.info('店铺详细地址不能为空');
					return false;
				}
				if (!validate(this.dataMessage.store_introduce, 'require')) {
					this.$message.info('店铺简介不能为空');
					return false;
				}
				if (!validate(this.dataMessage.service_phone, 'require')) {
					this.$message.info('客服电话不能为空');
					return false;
				}
				//请求方法
				//数据验证

				let data62bd977cbc707 = await this.$api.dbPost(global.apiUrls.post62bd977cbc707, {
					store_name: this.dataMessage.store_name,
					store_logo: this.dataMessage.store_logo,
					store_address: this.dataMessage.store_address,
					store_backdrop: this.dataMessage.store_backdrop,
					store_introduce: this.dataMessage.store_introduce,
					service_phone: this.dataMessage.service_phone,
					location: this.dataMessage.location
				});
				if (!data62bd977cbc707) return
				if (data62bd977cbc707.data.code != 1) {
					this.$message.info(data62bd977cbc707.data.msg);
					return
				}



				this.$urouter.navigateTo(`/pages/shopSettle/revieweds/revieweds`);
			},
			//获取店铺信息
			async getShopFunc() {
				//请求方法
				//数据验证

				let datadataMessage = await this.$api.get(global.apiUrls.post62be7019e6ae4, {

				});

				if (datadataMessage.data.code != 1) {
					this.$message.info(datadataMessage.data.msg);
					return
				}
				let infodataMessage = datadataMessage.data;
				this.dataMessage = infodataMessage.data

			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.informationShops_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.informationShops_fd0_1 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
		line-height: 50rpx;
	}

	.informationShops_fd0_0_c0 {
		width: 20rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.informationShops_fd0_0 {
		width: 100rpx;
		height: 88rpx;
	}

	.informationShops_flex_1 {
		background: #fff;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.informationShops_input_fd1_4_c1 {
		width: 100%;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		height: 160rpx;
	}

	.informationShops_fd1_4_c1 {
		background: rgba(246, 247, 249, 1);
		width: 686rpx;
		background-size: 100% auto !important;
		padding: 24rpx 24rpx 24rpx 24rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.informationShops_fd1_4_c0 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.informationShops_fd1_3_c3 {
		width: 19rpx;
		height: 28rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.informationShops_fd1_3_c2_1 {
		text-align: right;
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.informationShops_fd1_3_c2 {
		text-align: right;
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(191, 191, 191, 1);
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.informationShops_fd1_2_c3_image {
		width: 180rpx;
		height: 180rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.informationShops_fd1_1_c3_image {
		width: 180rpx;
		height: 180rpx;
	}

	.informationShops_fd1_1_c2 {
		color: #929292;
		font-size: 26rpx;
		font-weight: 400;
		line-height: 37rpx;
		margin: 0rpx auto 0rpx 14rpx;
	}

	.informationShops_fd1_1_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.informationShops_fd1_0_c2 {
		margin: 0rpx 0rpx 0rpx 32rpx;
		text-align: right;
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.informationShops_fd1_0_c1 {
		color: #2A2A2A;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 42rpx;
	}

	.informationShops_fd1_0_c0 {
		color: var(--benbenFontColor5);
	}

	.informationShops_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 30rpx 0rpx 30rpx 0rpx;
	}

	.informationShops_picker2_0_c2 {
		color: var(--benbenFontColor4);
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.informationShops_picker2_0_c1 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
		line-height: 40rpx;
	}

	.informationShops_picker2_0_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.informationShops_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 110rpx;
	}

	.informationShops_flex_3 {
		background: rgba(248, 248, 248, 1);
		width: 750rpx;
		height: 180rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
		background-size: 100% auto !important;
	}

	.informationShops_fd3_1 {
		background: var(--benbenbgColor2);
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		width: 328rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-weight: 500;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.informationShops_fd3_0 {
		border: 1px solid var(--benbenbdColor0);
		background: var(--benbenbgColor1);
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor0);
		width: 328rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-weight: 500;
	}
</style>